package com.liangzhong.model.activity.vip
{
	public class VipVo
	{
		public function VipVo()
		{
		}
		/**
		 *vip等级 
		 */
		public var lv:int;
		/**
		 *达到该等级 需要的费用  
		 */
		public var cost:int;
		/**
		 *buff描述 
		 */
		public var buffer:String;
		/**
		 *超值礼包 
		 */
		public var giftbag:Array;
		/**
		 *每日奖励 
		 */
		public var daily:Array;
		
		/**
		 *解析 
		 * @param xml
		 * 
		 */
		public function analysisXml(xml:XML):void
		{
//			giftbag = [];
//			daily = [];
			lv = xml.lv;
//			trace(lv);
			buffer = xml.buff;
			cost = xml.cost;
			var str:String;
//			trace(buffer);
			str = xml.giftbag;
			var arr:Array = str.split(",");
			giftbag = vipAward(arr);
//			trace(str);
			str = xml.daily;
			arr = str.split(",");
			daily = vipAward(arr);
//			trace(str);
		}
		
		/**
		 *奖励 
		 * 
		 */
		private function vipAward($arr:Array):Array
		{
			var len:int = $arr.length;
			var vo:VipAwardVo;
			var arr:Array = [];
			for(var i:int = 0;i < len;i++)
			{
				vo = new VipAwardVo();
				vo.analysisStr($arr[i]);
				arr.push(vo);
			}
			return arr;
		}
		/**
		 *活动vip 
		 * 
		 */
		public function analysisActivityVip(xml:XML):void
		{
			lv = xml.lv;
			var str:String;
			str = xml.award;
			var arr:Array = str.split(",");
			daily = vipAward(arr);
		}
	}
}